home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-08-06 | 1.6 KB | 54 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CTCPServerThread.h ©1995-1998 Metrowerks Inc. All rights reserved.
- // ===========================================================================
-
- #pragma once
-
- #include <LTCPEndpoint.h>
- #include <LThread.h>
- #include <LSemaphore.h>
-
- #include "CSimpleTCPServer.h"
- #include "CTerminalPane.h"
-
- class CSimpleTCPServer;
-
- // ===========================================================================
- // • CTCPServerThread
- // ===========================================================================
- // The thread that actually does the work of the server responder.
- // Note that typed characters (i.e. data sent to the remote host
- // are NOT handled by this object.) Only incoming data are processed
- // here.
-
- class CTCPServerThread : public PP_PowerPlant::LThread {
-
- public:
- CTCPServerThread(
- UInt16 inMaxConnections,
- UInt16 inLocalPort,
- PP_PowerPlant::LTCPEndpoint* inNetworkEndpoint,
- CSimpleTCPServer* inServerMaster);
- virtual ~CTCPServerThread();
-
- void StartDisconnect();
-
- protected:
- virtual void* Run();
- virtual void SuspendServerThread();
- virtual void ResumeServerThread();
-
- PP_PowerPlant::LTCPEndpoint* mEndpoint;
- CSimpleTCPServer* mServerMaster;
- UInt16 mMaxConnections;
- UInt16 mPort;
-
- bool mDisconnectReceived; // true if a T_DISCONNECT or T_ORDREL
- // event has occurred
- bool mStartDisconnect; // true if StartDisconnect() was called
-
- PP_PowerPlant::LSemaphore mConnectionSignal;
-
- friend class CSimpleTCPServer;
- };
-